/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nominalitzacions.ui;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
import nominalitzacions.domain.UrlDomainController;

/**
 *
 * @author daniel.camacho.rodriguez
 */
public class HelpViewController {

    private HelpView HV;
    
    private UrlDomainController UDC;

    public HelpViewController() throws IOException{
        HV = new HelpView(this);
        UDC = new UrlDomainController();
    }

    public void setVisible() {
        HV.setVisible();
    }

    public void setVisible(String what){
        HV.runWith(what);
    }

    public String getPage() throws FileNotFoundException {
        if(UDC==null) UDC = new UrlDomainController();
        String pageContent = "";
        System.out.println("iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
        System.out.println(UDC.gotRes());
        System.out.println("Manual.txt");
        File page = new File(UDC.gotRes()+"Manual.txt");
        System.out.println(page.getAbsolutePath());
        Scanner sc = new Scanner(page);
        
        while (sc.hasNext() ) pageContent += sc.next();
       
        return pageContent;
    }
    
    public String getUrlLang(){
        return UDC.gotRes();
    }

}
